package com.direct.service;

import com.direct.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @author caixiaofeng
 * @company xxx公司科技有限公司
 * @create 2020-04-21 20:24
 */
@FeignClient(value = "springcloud-provider-dept", fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

    @GetMapping("/dept/{deptno}")
    Dept queryById(@PathVariable("deptno") Long deptno);

    @GetMapping("/depts")
    List<Dept> queryAll();

    @PostMapping("/dept")
    void addDept(Dept dept);
}
